rm(list=ls())
d.competence.todorov <- read.csv("data-competence.csv")

# Figure C2 -----------------------------------------------------

nrow(model.frame(lm(todorov_winner_comp~meansim,d=d.competence.todorov)))

gg.competence <- ggplot(d.competence.todorov, aes(x=meansim, y=todorov_winner_comp)) + 
  geom_point(size=5, color="black") +
  geom_smooth(method=lm, se=FALSE, linetype="solid", color="red", lwd=1.2) + 
  stat_cor(p.accuracy = 0.01, r.accuracy = 0.01, label.x = 23, label.y = .3, col="black", size=4) +
  xlab("Resemblance")+ ylab("Competence")  + xlim(10,25) + theme_minimal() + 
  theme(axis.text = element_text(size=14), axis.text.x = element_text (margin=margin(0,0,18,0)), axis.title = element_text(size=17), legend.position = "none") 
gg.competence
ggsave("FigureC2.pdf", width = 15, height = 10, units = "in")







